package com.ccb.sc.common.modules.luxury.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * @author ken
 * @since 2020-09-15
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@Getter
public enum LuxuryStatus implements IEnum<Integer> {

    /**
     * 状态 -1回收失败 0用户申请 1平台估价 2快递邮寄 3平台验收 4回收完成
     */
    FAIL(-1, "回收失败"),

    APPLY(0, "用户申请"),


    ASSESS(1, "平台估价"),


    EXPRESS(2, "快递邮寄"),


    ACCEPTANCE_CHECK(3, "平台验收"),


    FINISHED(4, "回收完成"),


    ;

    private int value;
    private String desc;

    LuxuryStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static LuxuryStatus getByValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (LuxuryStatus luxuryStatus : LuxuryStatus.values()) {
            if (luxuryStatus.getValue() == value.intValue()) {
                return luxuryStatus;
            }
        }
        return null;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }
}
